package com.geostar.constructionland.analyse.service.analyseresult.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.geostar.constructionland.common.dao.YzGeoJsonDao;
import com.geostar.constructionland.analyse.entity.alyresult.tzhdlgdfx.AlyResultDlfx;
import com.geostar.constructionland.analyse.mapper.sptalyresult.AlyResultDlfxMapper;
import com.geostar.constructionland.analyse.service.analyseresult.JysdFxDlfxService;
import com.geostar.constructionland.common.entity.logs.mongolog.YzGeoJson;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class JsydFxDlfxServiceImpl extends ServiceImpl<AlyResultDlfxMapper,AlyResultDlfx> implements JysdFxDlfxService {
    @Autowired
    YzGeoJsonDao yzGeoJsonDao;
    public List<AlyResultDlfx> getMmjjsDlfxs(String fxbs){
        List<AlyResultDlfx> dlfxList = this.baseMapper.getMmjjsDkxx(fxbs);
        for(AlyResultDlfx dlfx : dlfxList){
            if(StringUtils.isNotBlank(dlfx.getMongoId())){
                YzGeoJson yzGeoJson = yzGeoJsonDao.queryYzGeoJson(dlfx.getMongoId());
                dlfx.setYzGeoJson(yzGeoJson);
            }
        }
        return dlfxList;
    }
}
